import axios from 'axios'
export function send(url,data,type){
    //封装数据
    var d = new FormData()
    for(var key in data){
        d.append(key,data[key])
    }
    return axios({
        url:url,
        data:data,
        method:type,
        responseType:'json',
    })
}

export function sendToken(url,data,type){
    //封装数据
    var d = new FormData()
    for(var key in data){
        d.append(key,data[key])
    }
    var token = sessionStorage.getItem('token')
    console.log("token******"+token)
    return axios({
        url:url,
        data:data,
        method:type,
        responseType:'json',
        headers: {
            'Authorization': 'JWT ' + token
        },
    })
}